package com.chen.framework.config;

import com.chen.base.module.log.component.SysLogHandlerInter;
import com.chen.base.module.log.dto.AccessLogDTO;
import com.chen.base.utils.ConvertUtil;
import com.chen.framework.mapper.SysAccessLogMapper;
import com.chen.framework.model.sys.SysAccessLog;
import org.springframework.stereotype.Component;

import javax.annotation.Resource;

/**
 * @author: ~龙~
 * @DATE: 2023/11/24
 **/
@Component
public class SysLogConfig implements SysLogHandlerInter {

    @Resource
    SysAccessLogMapper sysAccessLogMapper;

    @Override
    public void logHandler(AccessLogDTO logDto) {
        SysAccessLog log = ConvertUtil.convertor(logDto, SysAccessLog.class);
        sysAccessLogMapper.insert(log);
    }
}
